﻿using System.Collections.Generic;
using WebApplication1.classes.Core.Chrome.Bookmarks.Model;

namespace WebApplication1.classes.Core.Chrome.Bookmarks.Wrapper {
    public class BookmarkRoots : Bookmark {
        public BookmarkRoots() {
            name = "roots";

            other = new BookmarkOther();
            other.setParent( this );

            bookmark_bar = new BookmarkBar();
            bookmark_bar.setParent( this );
        }

        public BookmarkBar bookmark_bar { get; set; }

        public BookmarkOther other { get; set; }

        public override IList<Bookmark> childrenToList() {
            return new List<Bookmark> { bookmark_bar, other };
        }

        public override void assignTo(ChromeBookmark item){
        base.assignTo(item);
            var itemToAssign = (BookmarkRoots) item;
                other.assignTo( itemToAssign.other);
                bookmark_bar.assignTo( itemToAssign.bookmark_bar);
        }
    }
}